import request from "@/utils/http";

export const getAddressAPI = () => { // 获取地址数据
  return request({
    url: "/member/address",
  });
};
 
export const addressAPI = (data) =>{ // 新增地址
  return request({
    url: "/member/address",
    method: "post",
    data
  })
}

export const updateAddressAPI = (id, data) => { // 修改收货地址
  return request({
    url: `/member/address/${id}`,
    method: "put",
    data,
  });
};

export const getAddressDetailAPI = (id)=>{ // 获取收货地址详情
  return request({
    url: `/member/address/${id}`
  })
}

export const delAddressAPI = (id) => { // 删除收货地址
  return request({
    url: `/member/address/${id}`,
    method: "delete",
  });
};